<!--
    /**
     * 字典树形下拉选择组件：继承自树形下拉选择组件
     * @see @/components/TreeSelect
     * 使用方法
     * <dict-tree-select v-model="form.entry.parentId" :readonly="!form.editable" :key="form.entry.id"></dict-tree-select>
     */
-->
<script>
/**
 * 路由菜单树形下拉选择组件：继承自树形下拉选择组件
 * @see @/components/TreeSelect
 */
import TreeSelect from "@/components/TreeSelect";

export default {
  extends: TreeSelect,
  name: 'RouterMenuChooser',
  props: {
    nodeProps: {
      type: Object, default() {
        return {children: 'children', label: 'name', tags: ['modelName']}
      }
    },
    nodeKey: {
      type: String, default() {
        return 'id'
      }
    },
  },
  data() {
    return {
      treeData: []
    };
  },
  mounted() {
    if (!(this.nodeData && this.nodeData.length > 0)) {
      this.loadData()
    }
  },
  methods: {
    loadData() {
      this.treeData = this.$router.options.routes
    }
  },
};
</script>

